package org.jeecg.modules.zhaojd.listener;

import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.springframework.web.client.RestTemplate;

import java.util.Map;

public class SantydbThread implements Runnable {
    Logger _logger;
    String _url;
    RestTemplate _restTemplate;
    Map<String, Object> _params;

    public SantydbThread(Logger logger, String url, RestTemplate restTemplate, Map<String, Object> params) {
        this._logger = logger;
        this._url = url;
        this._restTemplate = restTemplate;
        this._params = params;
    }

    @Override
    public void run() {
        String json = JSON.toJSONString(this._params);
        this._logger.info(this._url + json);

        String rtn = this._restTemplate.getForObject(this._url, String.class, json);

        this._logger.info(rtn);
    }
}
